fix(config-flow): make pairing menu actually render (v1.1.2)#4
Merged
Conversation
…y renders v1.1.1 regressed: async_step_user returned a menu with step_id="menu" but async_step_menu had been removed. HA validates that a shown step_id resolves to an async_step_<id> handler and raises UnknownStep otherwise, so opening "Add device" errored instead of showing the menu. The unit test that called async_step_user directly never exercised HA's step-existence check, so it passed. - async_step_user now delegates to async_step_menu (restored), which serves async_show_menu(step_id="menu", ...). Both methods exist, satisfying HA's subentry-flow contract. - add test_subentry_flow_entry_step_is_menu: drives the real seam hass.config_entries.subentries.async_init(...) and asserts the menu is the first step — this is the test that catches entry-point/step-existence bugs that direct handler-method calls cannot. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QwPMgtiypLgJ5nkR3mUGfL
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QwPMgtiypLgJ5nkR3mUGfL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v1.1.1 was broken and must be superseded. The fix made
async_step_userreturn a menu withstep_id="menu", butasync_step_menuhad been removed. HA validates that a shownstep_idresolves to anasync_step_<id>handler and raisesUnknownStepotherwise — so opening "Add device" would error instead of showing the menu. The unit test calledasync_step_userdirectly and never exercised HA''s step-existence check, so it passed.This was caught by a new flow-seam test driving the real
hass.config_entries.subentries.async_init(...)— exactly the gap identified in the v1.1.0 post-mortem.Changes
async_step_usernow delegates toasync_step_menu(restored), which servesasync_show_menu(step_id="menu", ...). Both methods exist → satisfies HA''s subentry-flow contract.test_subentry_flow_entry_step_is_menu: drivessubentries.async_initand asserts the menu is the first step. Directhandler.async_step_x(None)calls cannot catch step-existence/entry-point bugs; this can.Verification
ruff✅ ·mypy✅ · fullpytest165 passed (WSL), including the new seam test which fails against the v1.1.1 code.Release
Patch bump
manifest.json→ 1.1.2. Tagv1.1.2after merge.🤖 Generated with Claude Code